<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cool.js</title>
<style>
    html,body{
        padding: 0 0 0 0;
        margin: 0 0 0 0;
    }
</style>
    <script src="../dist/cool.js"></script>

</head>
<body  oncontextmenu=self.event.returnValue=false>
    <canvas id="webgl" width="600" height="600">
        Please use a browser that supports "canvas"
    </canvas>
    <div id="param">

    </div>
</body>
<script>

    var image = new Image();
    image.crossOrigin = "anonymous";
    image.src='./img/head.jpg';

    var texture = new COOL.Texture({image:image});

    var material2 = new COOL.MeshLambertMaterial({map:texture, wireframe:true});


    var mesh2 = new COOL.Mesh({material:material2, geometry:new COOL.BoxGeometry()});


    var scene = new COOL.Scene();

    scene.add(mesh2);


    var ambientLight = new COOL.AmbientLight({intensity: 1.0});
    scene.add(ambientLight);

    var directionalLight = new COOL.DirectionalLight({intensity: 1.0, direction: [0.5,0.8,0.2]});
    scene.add(directionalLight);

    var camera = new COOL.Camera(30,1,1,1000);

    camera.setPosition([0, 30, 100]);

    var cameraController = new COOL.CameraController(camera);
    cameraController.update();

    var renderer = new COOL.Renderer({
    });

    function renderLoop() {
       renderer.render(scene,camera);
       mesh2.rotateY(0.03);
       requestAnimationFrame(function () {
           renderLoop();
       });
    }

    renderLoop();

</script>
</html>
